﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using TangoGames.Base;
using TangoGames.Scene;

namespace TangoGames.Primitives3D
{
    public class TexturedPrimitive : GeometricPrimitive
    {

        public TexturedPrimitive(GraphicsDevice graphicsDevice, Texture2D texture)
        {

            AddVertex(new Vector3(-0.5f, 0, -0.5f), Vector3.Up, new Vector2(0, 0));
            AddVertex(new Vector3(0.5f, 0, -0.5f), Vector3.Up, new Vector2(1, 0));
            AddVertex(new Vector3(0.5f, 0, 0.5f), Vector3.Up, new Vector2(1, 1));
            AddVertex(new Vector3(-0.5f, 0, 0.5f), Vector3.Up, new Vector2(0, 1));
            AddIndex(0);
            AddIndex(1);
            AddIndex(2);

            AddIndex(0);
            AddIndex(2);
            AddIndex(3);

            this.InitializePrimitive(graphicsDevice);

            this.RenderTexture(texture);

        }
    }
}
